home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Prog / N-P / OmniScript 2.0.1 / Examples / Dialogs, Lists & Menus / Modeless Dialogs < prev   
Encoding:
Text File  |  1993-09-30  |  2.3 KB  |  98 lines  |  [TEXT/ExPr]

  1. *    define a submenu
  2. *
  3. x = 'abc def ghijk/3<I lm'
  4. lval x,submenu
  5. menu new,21,-1,submenu
  6. *
  7. *    define a sample menu and add to menu bar
  8. *
  9. menuscript 21,'MenuResponse'
  10. *
  11. *    the dialog template is stored in the following file
  12. rfopen 'dialog resources'
  13. *
  14. *    the dialog displays the list $ll created from a user selected directory
  15. *
  16. dir
  17. listdir $ll
  18. list $ll
  19. *
  20. *    items 3 & 4 form Group A Radio Buttons
  21. *    items 6 & 7 form Group A Radio Buttons
  22. *
  23. $dloglist[1] = 'dOK'
  24. $dloglist[2] = 'rReset'
  25. $dloglist[3] = 'eGroup A #1'
  26. $dloglist[4] = 'sGroup A #2'
  27. $dloglist[5] = ''
  28. $dloglist[6] = 'sGroup B #1'
  29. $dloglist[7] = 'eGroup B #2'
  30. $dloglist[8] = ''
  31. $dloglist[9] = 'item 9 initial text'
  32. $dloglist[10] = ''
  33. $dloglist[11] = 'item 11 initial text'
  34. $dloglist[12] = ''
  35. *
  36. *    item 13 is a pop-up menu initialised to show the second item in the list
  37. *
  38. menuset 20,2
  39. $dloglist[13] = 21
  40. $dloglist[14] = 'epop-up:'
  41. *
  42. *    item 15 is the directory list with the following attributes
  43. *      preselection (2nd character is lowercase)
  44. *        select multiple items (3rd & 4th characters are 00)
  45. *        single click does an update and reset
  46. *        double click processed by script but no update or reset
  47. *
  48. $dloglist[15] = 'yb00$ll'
  49. *
  50. *    item 16 is an arbitrary list with the following attributes
  51. *      no preselection (2nd character is uppercase)
  52. *        select one item only (3rd & 4th characters are 80)
  53. *        single click does an update and reset
  54. *        double click looks like OK button
  55. *
  56. $dloglist[16] = 'oB80$aaa'
  57. x = '"item 1" "item 2" "item 3"'
  58. lval x,$aaa
  59. *
  60. *show the dialog
  61. *
  62. modeless new,11,'ModeScript',$dloglist
  63. modeless show,11
  64. debug off
  65. *
  66. script MenuResponse
  67. display 'MenuResponse: ' #arg(1)':'#arg(2)
  68. *
  69. script ModeScript
  70. display 'Start ModeScript: ' #arg(1)':'#arg(2)
  71.  
  72. if #arg(1) = 1
  73.     disp '** Dialog State **'
  74.     x = 1
  75.     test ($dloglist[4](1) = 's') x = 2
  76.     disp 'Button #'x' selected in Group 1'
  77.     x = 1
  78.     test ($dloglist[7](1) = 's') x = 2
  79.     disp 'Button #'x' selected in Group 2'
  80.     if $dloglist[5](1) = 's'
  81.         disp 'Check Box Selected'
  82.     else
  83.         disp 'Check Box Not Selected'
  84.     end
  85.     disp 'First Text Edit Item: '$dloglist[9]
  86.     disp 'Second Text Edit Item: '$dloglist[11]
  87. else if #arg(1) = 2
  88.     display 'Reset selected: Edit items will be reset'
  89. else if #arg(1) >= 15
  90.     if $aaa[-1] > 0 && $ll[-1] > 0
  91.         test ($dloglist[1](1) = 'd') $dloglist[1](1) = 'B'
  92.     else
  93.         test ($dloglist[1](1) = 'b') $dloglist[1](1) = 'D'
  94.     end
  95. end
  96.  
  97. display 'End ModeScript'
  98.